package org.client.otdr;

import org.client.otdr.resolver.IorResolver;
import org.client.otdr.resolver.MarkerResolver;
import org.client.otdr.resolver.TraceResolver;
import org.openems.entity.Key;

import framework.Resolver;
import framework.resolver.GreaterResolver;
import framework.resolver.LessResolver;
import framework.resolver.UnitResolverRegister;
import framework.resolver.ResolverHelper;

public class OtdrResolver extends ResolverHelper {

	private void setRelation(UnitResolverRegister register, Key lessKey, Key greaterKey) {
		register.add(lessKey, new LessResolver(lessKey, greaterKey));
		register.add(greaterKey, new GreaterResolver(greaterKey, lessKey));
	}

	@Override
	protected void configure(UnitResolverRegister register) {
		OTDRID id = OTDRID.get();
		register.add(id.IOR, new IorResolver());
		register.add(id.TRACE, new TraceResolver());
		register.add(id.GOOGLEMAPMARKER, new MarkerResolver(id.GOOGLEMAPMARKER));
//		setRelation(register, id.MARKERA, id.MARKERB);
//		setRelation(register, id.MARKERB, id.MARKERC);
//		setRelation(register, id.MARKERC, id.MARKERD);
//		setRelation(register, id.MARKERD, id.MARKERE);
	}
}
